lights = {}

lights[1]  = {
		--pos = {1148.18, 208.778, -450.523 },
		pos = { 0.0, -28.0, 284.0},
		col = {128.0, 128.0, 128.0 },
		id = 1,
		intensity = 1000.0
		}


materials = {}

materials[1] = {
	Name = "rockwall",
	
	Texture = "white.tga",
	NormalTexture = "rockwall_normal.tga",
	SpecularTexture = "rockwall_height.tga",
	AmbiantColor = {0.3, 0.6, 0.2},
	Shinies = 0.3,
}


model = {}


model[1] = {
	Name ="plane",
	Model = "ST-n.obj";
}
entity = {}


entity[1] = 
{
	id = 1,
	Model = "plane",
	Position = {0.0, 0.0, -20.0},
	Rotation = {0.0, 0.0, 0.0},
	Scale = { 1.0, 1.0, 1.0}
}
--[[

entity[2] = 
{
	id = 2,
	Model = "plane",
	Position = {0.0, 0.0, 0.0},
	Rotation = {45.0, 0.0, 0.0},
	Scale = { 2.0, 2.0, 2.0}
}

entity[3] = 
{
	id = 3,
	Model = "plane",
	Position = {0.0, 0.0, 0.0},
	Rotation = {45.0, 0.0, 0.0},
	Scale = { 2.0, 2.0, 2.0}
}
entity[4] = 
{
	id = 4,
	Model = "plane",
	Position = {0.0, 0.0, 0.0},
	Rotation = {60.0, 0.0, 0.0},
	Scale = { 1.0, 1.0, 1.0}
}

entity[5] = 
{
	id = 5,
	Model = "plane",
	Position = {0.0, 0.0, 0.0},
	Rotation = {75.0, 0.0, 0.0},
	Scale = { 1.0, 1.0, 1.0}
}

entity[6] = 
{
	id = 6,
	Model = "plane",
	Position = {0.0, 0.0, 0.0},
	Rotation = {90.0, 0.0, 0.0},
	Scale = { 1.0, 1.0, 1.0}
}

--]]


function initWorld()

	io.write("LUA: init World Baby!\n")
	
	io.write("LUA: adding Lights.. ");
	
	for i=1,table.getn(lights) do
		addLight(lights[i].pos[1], lights[i].pos[2], lights[i].pos[3], lights[i].col[1], lights[i].col[2], lights[i].col[3], lights[i].intensity, lights[i].id);
	end
	io.write("Done!\n");
	io.write("LUA: adding Materials.. ");
	for i=1,table.getn(materials) do
		--addMaterial(materials[i].Name, materials[i].Texture, materials[i].NormalTexture, materials[i].SpecularTexture, materials[i].AmbiantColor[1],  materials[i].AmbiantColor[2],  materials[i].AmbiantColor[3],  materials[i].Shinies);  
	end
	io.write("Done!\n");
	io.write("LUA: adding Objects to Resources.. ");
	for i=1,table.getn(model) do
		addObject(model[i].Name, model[i].Model, model[i].Material);  
	end
	io.write("Done!\n");
	io.write("LUA: adding Entities to Scene.. ");
	for i=1,table.getn(entity) do
		addEntity(entity[i].id, entity[i].Model, entity[i].Position[1], entity[i].Position[2], entity[i].Position[3], entity[i].Rotation[1], entity[i].Rotation[2], entity[i].Rotation[3], entity[i].Scale[1], entity[i].Scale[2], entity[i].Scale[3]);  
	end
	io.write("Done!\n");
	
end

